package net.bwie.realtime.jtp.jdrealtimeservice.mapper;

import net.bwie.realtime.jtp.jdrealtimeservice.bean.ProvinceTotalPaymentWindowReport;
import net.bwie.realtime.jtp.jdrealtimeservice.bean.TopNitemWindowReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 简介说明:
 *
 * @author: LiLi
 * @date: 2025/05/28 12:45:39
 * @version: 1.0
 */
@Mapper
public interface ProvinceTotalPaymentMapper {

    @Select("select\n" +
            "round(sum(total_payment),2) as total_payment,\n" +
            "province\n" +
            "from jd_api_report.dws_province_total_payment_window_report\n" +
            "where toDate(window_start_time) = #{date} "+
            "group by province")

    List<ProvinceTotalPaymentWindowReport> selectTotalpayment(@Param("date") String date);

    @Select("select\n" +
            "    item,\n" +
            "    item_size\n" +
            "from jd_api_report.dws_topN_item_window_report\n" +
            "where toDate(window_start_time) = #{date}\n" +
            "group by  item, item_size\n" +
            "order by  item_size desc\n" +
            "limit 10")


    List<TopNitemWindowReport> selectTopNitem(@Param("date")String date);

}
